/** TestSource.cpp
*
*  Created by Penrillian, Smartphone Software Innovators 
*  See http://www.penrillian.com
*/

#include "TestHeader.h"
#include "TestDriver.h"
#include "Logger.h"

#include <xmlrpc.h>


_LIT8(KCDecodeTestData, "Foobar&amp; adfasdF&lt; ASDF &QUOT; &Gt; &quOt; &Apos;");
_LIT(KCEncodeTestData, "Foobar& adfasdF< ASDF \" > \" '");

void CEncodingTest::testEncodeL()
	{
	RBuf8 output;
	CleanupClosePushL(output);
	XmlRpc::XmlEncoding::EncodeL(KCEncodeTestData(), output);
	TS_ASSERT_EQUALS(output.CompareC(KCDecodeTestData), 0);

	CleanupStack::PopAndDestroy(&output);
	}

void CEncodingTest::testDecodeL()
	{
	RBuf output;
	CleanupClosePushL(output);
	XmlRpc::XmlEncoding::DecodeL(KCDecodeTestData(), output);
	
	TS_ASSERT_EQUALS(output.Compare(KCEncodeTestData()), 0);

	CleanupStack::PopAndDestroy(&output);
	}
